﻿namespace _12.GSMCallHistoryTest
{
    using System;
    using System.Linq;
    using _01.MobileDevice;

    public class GSMCallHistoryTest
    {
        public static void Main()
        {
            GSM gsm = new GSM("S4", "Samsung", 899, null, new Display(5, 16000000), new Battery("2600mAh", BatteryType.LiIon, 370, 17));
            gsm.AddCall(new Call(DateTime.Now, "+359899888888", TimeSpan.FromSeconds(56)));
            gsm.AddCall(new Call(DateTime.Now.AddHours(1.8), "+359891234567", TimeSpan.FromSeconds(15)));
            gsm.AddCall(new Call(DateTime.Now.AddHours(1.5), "+359890000000", TimeSpan.FromMinutes(3)));
            gsm.AddCall(new Call(DateTime.Now.AddDays(2.1), "+359899999999", TimeSpan.FromSeconds(44)));

            Console.WriteLine("Call history list:");
            Console.WriteLine(gsm.GetCallHistory());

            Console.WriteLine("Total price of the calls: {0}", gsm.CalculateTotalCallsPrice(0.37m));
            Console.WriteLine();

            gsm.DeleteLongestCall();
            Console.WriteLine("Call history list after longest call deletion:");
            Console.WriteLine(gsm.GetCallHistory());

            Console.WriteLine("Call history list after clear:");
            gsm.ClearCallHistory();
            Console.WriteLine(gsm.GetCallHistory());
        }
    }
}
